package com.feizhaiyou.demo.controller;

import com.feizhaiyou.demo.service.DataSource1Service;
import com.feizhaiyou.demo.service.DataSource2Service;
import com.feizhaiyou.demo.service.DataSource3Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * @author Jason
 */
@RestController
public class TestController {


    @Autowired
    private DataSource1Service dataSource1Service;
    @Autowired
    private DataSource2Service dataSource2Service;
    @Autowired
    private DataSource3Service dataSource3Service;

    @GetMapping("/master")
    public List<HashMap> getData1() {
        return dataSource1Service.getData();
    }

    @GetMapping("/slave")
    public List<HashMap> getData2() {
        return dataSource2Service.getData();
    }

    @GetMapping("/slave2")
    public List<HashMap> getData3() {
        return dataSource3Service.getData();
    }


}
